﻿@model EmpireDirectory.Models.Character

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>
<form method="post">
    @Html.HiddenFor(x=>x.ID)

@Html.LabelFor(x=>x.Name)
@Html.EditorFor(x => x.Name, new {@class="form-control" })
<br />
@Html.LabelFor(x => x.Image)
@Html.EditorFor(x => x.Image, new { @class = "form-control" })
<br />
@Html.LabelFor(x => x.Quote)
@Html.EditorFor(x => x.Quote, new { @class = "form-control" })
<br />
@Html.LabelFor(x => x.Weapon)
@Html.EditorFor(x => x.Weapon, new { @class = "form-control" })
<br />
@Html.LabelFor(x => x.Bio)
@Html.EditorFor(x => x.Bio, new { @class = "form-control" })
<br />
<select name="affiliation">
    <option value="Empire">Empire</option>
    <option value="Rebel">Rebel</option>
    <option value="Mercenary">Mercenary</option>
</select>

@if (Model.GetType().ToString() == "EmpireDirectory.Models.Jedi")
{
    @Html.Partial("_JediEdit", (EmpireDirectory.Models.Jedi)Model)
}
else if (Model.GetType().ToString() == "EmpireDirectory.Models.BountyHunter")
{

    @Html.Partial("_BountyHunterEdit", (EmpireDirectory.Models.BountyHunter)Model)
}

<input type="submit" value="Save" class="btn btn-success pull-right" /><br />
</form>
<form method="post" action="/Home/Delete/@Model.ID">
    <input type="submit" class="btn btn-danger" value="Delete" />
</form>

